#Variables
lib_file='p4f'

#cross building with mingw?
if(ARGUMENTS.get('mingw',0)):
	env = Environment(tools=['mingw'])
else:
	env = Environment()

env['CCCOMSTR']='[C]  $SOURCES'
env['CPPPATH']='include'
if env['PLATFORM'] == 'win32':
	env['LIBS']='ws2_32'
else:
	env['LIBS']='pthread'

#Build with debug information?
debug = ARGUMENTS.get('debug', 0)
if int(debug):
	#If you need to add debug information, do it between defines (P4F_DEBUG)
	env.Append(CCFLAGS = ' -g -D P4F_DEBUG')
	env['CCCOMSTR']='[C] [DBG] $SOURCES'

#Use this environment to compile the objects ;)
Export('env')
objs=(SConscript(['src/SConscript'],'env'))


#Link all the objects in a static library
env.StaticLibrary(lib_file,objs)
